package com.ken.apollo.controller;


import com.ken.apollo.commons.result.R;
import com.ken.apollo.domain.entity.ProductClassify;
import com.ken.apollo.domain.query.ProductClassifyQuery;
import com.ken.apollo.service.ProductClassifyService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 产品分类表(ProductClassify)表控制层
 *
 * @author makejava
 * @since 2025-06-09 20:11:41
 */
@RestController
@RequestMapping("/api/classify")
public class ProductClassifyController {
    /**
     * 服务对象
     */
    @Resource
    private ProductClassifyService productClassifyService;

    /**
     * 查询所有产品分类
     */
    @GetMapping("/list")
    public R<List<ProductClassify>> queryAll(ProductClassifyQuery productClassifyQuery) {
        return R.success(productClassifyService.queryAll(productClassifyQuery));
    }

    /**
     * 保存产品分类
     */
    @PostMapping("/save")
    public R<Boolean> save(ProductClassify productClassify) {
        return R.success(productClassifyService.save(productClassify));
    }

    /**
     * 删除产品分类
     */
    @GetMapping("/remove")
    public R<Boolean> removeById(Long id) {
        return R.success(productClassifyService.removeById(id));
    }
}

